package com.wwj.my_ummary;

import com.jxhh.ApiClient;
import com.jxhh.ApiResponse;
import com.jxhh.exception.ApiRequestException;
import com.jxhh.exception.MustParamsException;
import com.jxhh.goods.GoodsComments;
import com.jxhh.goods.GoodsCommentsRequest;

import java.io.IOException;
import java.util.List;

public class Mys {
    public static void main(String[] args) throws MustParamsException, ApiRequestException, IOException {
        String appKey = "D7C6CF345DE47803EDBE9656E055EA99"; //appkey
        String appSecret = "0BB4662736B4788177EAE29DF5D526F6";    //app秘钥


        //获取api
        ApiClient apiClient = new ApiClient(appKey, appSecret);
        apiClient.setDebug(true); //设置调试模式
        //获取商品评论
        GoodsCommentsRequest goodsCommentsRequest = new GoodsCommentsRequest();
        goodsCommentsRequest.setPage(1);
        goodsCommentsRequest.setLimit(10);
        goodsCommentsRequest.setSku((long)7791645);
        ApiResponse<GoodsComments> apiResponse = apiClient.exec(goodsCommentsRequest);
        List<GoodsComments> list = apiResponse.getLists();
        System.out.println(apiResponse.getCount());



    }


}
